<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include_once("../config.inc.php");

$intLottoID = (int)$_data["LottoID"];
if(!$intLottoID)$intLottoID = 1;
$arrOPlus = $_data["OPlus"];

$_LangPath = "memcreditdata";	//語言檔參數，務必放在最前面

include_once(__Member_Path."/logincheck.php");
include_once(__Language_Path."/selectlanguage_member.php");
include_once(__Modules_Path."/SelectGambleType.lib.php");
include_once(__Modules_Path."/Commission.lib.php");

$objUser = $_SESSION["Member_Info"];

//找出使用者目前的退水
$arrUComm = getUserCommissionArray($objUser -> ID, $intLottoID);
if($arrUComm === false)ErrMsgOutputHTML("Error", "", 1);

$arrUserOPlus = $_SESSION["Member_Info"] -> UserCommToOdds;
foreach($arrUComm[$intLottoID] as $intBT => $arrC){
	$arrApointNumTip = $_arrGLineApointNumTip[$intLottoID][$intBT];
	if(!is_array($arrApointNumTip))$arrApointNumTip = array("");
	foreach($arrApointNumTip as $intAN => $strApointTip){
		$arrComm = $arrC[$objUser -> GambleType];
		if($arrOPlus[$intBT][$intAN] > (100 - $arrComm)){
			$arrOPlus[$intBT][$intAN] = 100 - $arrComm;
		}
		print $arrOPlus[$intBT][$intAN]."==".$intBT."==".$intAN."\n";
		if(!setUserCommToOdds($objUser -> ID, $objUser -> ID, $intLottoID, $intBT, $intAN, 11, $arrOPlus[$intBT][$intAN]))ErrMsgOutputHTML("Error", "", 1);
		$arrUserOPlus[$intLottoID][$intBT][$intAN][11] = $arrOPlus[$intBT][$intAN];
	}
}

$_SESSION["Member_Info"] -> UserCommToOdds = $arrUserOPlus;
/*
//找出 Lotto 的賠率兌換，傳回陣列
$arrORate = getArrayLottoChRateData($intLottoID);
if($arrORate === false)ErrMsgOutputHTML("Error", "", 1);

//找出 使用者 的賠率兌換，傳回陣列
$arrUserORate = getUserCommToOdds($objUser -> ID, $intLottoID, array());
if($arrUserORate === false)ErrMsgOutputHTML("Error", "", 1);


//輸出
WebOutputHTML($fp, 1);
*/
header("Location: memcreditdata.php?LottoID=".$intLottoID);
?>